package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.UserTransactionRecordMapper;
import com.ruoyi.system.domain.UserTransactionRecord;
import com.ruoyi.system.service.IUserTransactionRecordService;

/**
 * 用户交易记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-02
 */
@Service
public class UserTransactionRecordServiceImpl implements IUserTransactionRecordService 
{
    @Autowired
    private UserTransactionRecordMapper userTransactionRecordMapper;

    /**
     * 查询用户交易记录
     * 
     * @param id 用户交易记录主键
     * @return 用户交易记录
     */
    @Override
    public UserTransactionRecord selectUserTransactionRecordById(Long id)
    {
        return userTransactionRecordMapper.selectUserTransactionRecordById(id);
    }

    /**
     * 查询用户交易记录列表
     * 
     * @param userTransactionRecord 用户交易记录
     * @return 用户交易记录
     */
    @Override
    public List<UserTransactionRecord> selectUserTransactionRecordList(UserTransactionRecord userTransactionRecord)
    {
        return userTransactionRecordMapper.selectUserTransactionRecordList(userTransactionRecord);
    }

    /**
     * 新增用户交易记录
     * 
     * @param userTransactionRecord 用户交易记录
     * @return 结果
     */
    @Override
    public int insertUserTransactionRecord(UserTransactionRecord userTransactionRecord)
    {
        userTransactionRecord.setCreateTime(DateUtils.getNowDate());
        return userTransactionRecordMapper.insertUserTransactionRecord(userTransactionRecord);
    }

    /**
     * 修改用户交易记录
     * 
     * @param userTransactionRecord 用户交易记录
     * @return 结果
     */
    @Override
    public int updateUserTransactionRecord(UserTransactionRecord userTransactionRecord)
    {
        userTransactionRecord.setUpdateTime(DateUtils.getNowDate());
        return userTransactionRecordMapper.updateUserTransactionRecord(userTransactionRecord);
    }

    /**
     * 批量删除用户交易记录
     * 
     * @param ids 需要删除的用户交易记录主键
     * @return 结果
     */
    @Override
    public int deleteUserTransactionRecordByIds(Long[] ids)
    {
        return userTransactionRecordMapper.deleteUserTransactionRecordByIds(ids);
    }

    /**
     * 删除用户交易记录信息
     * 
     * @param id 用户交易记录主键
     * @return 结果
     */
    @Override
    public int deleteUserTransactionRecordById(Long id)
    {
        return userTransactionRecordMapper.deleteUserTransactionRecordById(id);
    }
}
